home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / addpcx.zip / LIB.H < prev    next >
C/C++ Source or Header  |  1988-04-17  |  693b  |  32 lines

  1. /*    Lib.h - miscellaneous definitions that come from library headers.
  2. */
  3.  
  4. #define uchar    unsigned char
  5. #define uint    unsigned int
  6. #define ulong    unsigned long
  7.  
  8. #define ERROR   (-1)        /* function failure return val        */
  9. #define OK      ( 0)        /* function success return val        */
  10.  
  11. /*    DDJ, April 1987, page 138. 
  12. */
  13. #ifdef ALLOCATE
  14. #define INIT(x) = { x }
  15. #define GLOBAL
  16. #else
  17. #define INIT(x)
  18. #define GLOBAL extern
  19. #endif
  20.  
  21.  
  22. #ifdef __STDC__
  23. #define CRASH(msg) { \
  24. printf( "\nFatal Error in \"%s\", line %d\n%s",\
  25. __FILE__,__LINE__,msg ); exit(1); }
  26. #else
  27. #define CRASH(msg) { printf("\nFatal Error: %s\n", msg ); exit(1); }
  28. #endif
  29.  
  30. #define NELEMS(x) (sizeof(x)/sizeof(*x))
  31.  
  32.